﻿create procedure [dbo].[usp_IIdentityUpdate] 
	@IIdentityId int
	, @ConcurrencyId timestamp
	, @SerializedIIdentityXml xml
	, @Name nvarchar(255)
	, @IsAuthenticated bit
	, @AuthenticationType nvarchar(255)
as

begin try
	
	begin transaction
	
		update [dbo].[IIdentity]
		set
			[Name] = @Name
			, [IsAuthenticated] = @IsAuthenticated
			, [AuthenticationType] = @AuthenticationType
			, [SerializedIIdentityXml] = @SerializedIIdentityXml
		where [IIdentityId] = @IIdentityId and [ConcurrencyId] = @ConcurrencyId
		
	commit transaction

end try
	
begin catch
	if @@trancount > 0
	begin
		rollback transaction;
	end
	execute [dbo].[usp_SqlErrorInsert]
end catch